package com.ruoyi.zhike.system.service.impl;

import java.util.List;
import java.util.Map;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zhike.db.mapper.SmsRecordInfoMapper;
import com.ruoyi.zhike.db.domain.SmsRecordInfo;
import com.ruoyi.zhike.system.service.ISmsRecordInfoService;

import javax.annotation.Resource;

/**
 * 短信发送记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-17
 */
@Service
public class SmsRecordInfoServiceImpl implements ISmsRecordInfoService 
{
    @Resource
    private SmsRecordInfoMapper smsRecordInfoMapper;

    /**
     * 查询短信发送记录
     * 
     * @param id 短信发送记录主键
     * @return 短信发送记录
     */
    @Override
    public SmsRecordInfo selectSmsRecordInfoById(Long id)
    {
        return smsRecordInfoMapper.selectSmsRecordInfoById(id);
    }

    /**
     * 查询短信发送记录列表
     * 
     * @param smsRecordInfo 短信发送记录
     * @return 短信发送记录
     */
    @Override
    public List<SmsRecordInfo> selectSmsRecordInfoList(SmsRecordInfo smsRecordInfo)
    {
        return smsRecordInfoMapper.selectSmsRecordInfoList(smsRecordInfo);
    }

    /**
     * 查询短信发送记录列表
     *
     * @param smsRecordInfo 短信发送记录
     * @return 短信发送记录
     */
    @Override
    public List<Map<String, Object>> selectSmsRecordInfoListMap(SmsRecordInfo smsRecordInfo)
    {
        return smsRecordInfoMapper.selectSmsRecordInfoListMap(smsRecordInfo);
    }

    /**
     * 新增短信发送记录
     * 
     * @param smsRecordInfo 短信发送记录
     * @return 结果
     */
    @Override
    public int insertSmsRecordInfo(SmsRecordInfo smsRecordInfo)
    {
        smsRecordInfo.setCreateTime(DateUtils.getNowDate());
        return smsRecordInfoMapper.insertSmsRecordInfo(smsRecordInfo);
    }

    /**
     * 修改短信发送记录
     * 
     * @param smsRecordInfo 短信发送记录
     * @return 结果
     */
    @Override
    public int updateSmsRecordInfo(SmsRecordInfo smsRecordInfo)
    {
        smsRecordInfo.setUpdateTime(DateUtils.getNowDate());
        return smsRecordInfoMapper.updateSmsRecordInfo(smsRecordInfo);
    }

    /**
     * 批量删除短信发送记录
     * 
     * @param ids 需要删除的短信发送记录主键
     * @return 结果
     */
    @Override
    public int deleteSmsRecordInfoByIds(Long[] ids)
    {
        return smsRecordInfoMapper.deleteSmsRecordInfoByIds(ids);
    }

    /**
     * 删除短信发送记录信息
     * 
     * @param id 短信发送记录主键
     * @return 结果
     */
    @Override
    public int deleteSmsRecordInfoById(Long id)
    {
        return smsRecordInfoMapper.deleteSmsRecordInfoById(id);
    }
}
